package com.persia.main

import com.persia.persistence.DbPool
import org.squeryl.{Session, SessionFactory}
import org.squeryl.adapters.MySQLAdapter
import com.persia.persistence.Db

object SquerylBootstrap {
   def init(){
     val ds = DbPool.initDataSource
     val adapter = new MySQLAdapter
     SessionFactory.concreteFactory = Some{()=>  Session.create(ds.getConnection, adapter)}
     //create table
     Db.createTables
   }
}